﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class D05_Vector3_4 : MonoBehaviour
{
    //AB的位置分别代表两个向量
    public Transform A, B;

    private void Update()
    {
        Debug.DrawLine(Vector3.zero, A.position, Color.red);
        Debug.DrawLine(Vector3.zero, B.position, Color.red);

        float dot = Vector3.Dot(A.position, B.position);//求点成值
        Debug.DrawLine(Vector3.zero, new Vector3(dot, 0), Color.green);//把点乘值画在X轴上
    }
}